import java.util.Arrays;

public class hw2 {
    public static void main(String[] args) {
        //3、静态初始化一维数组{10,20,11,35,6,89}，进行冒泡排序
        int[]num={10,20,11,35,6,89};
          int tmp=0;
        System.out.println("排序前：打印数组：" + Arrays.toString(num));
          for (int i=0;i<num.length-1;i++){
              for (int j=0;j<num.length-1-i;j++){
                  if (num[j]>num[j+1]){
                      tmp=num[j];
                      num[j]=num[j+1];
                      num[j+1]=tmp;
                  }
              }
          }
        System.out.println("排序后：打印数组：" + Arrays.toString(num));
    }
}
